home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / UCRASM25.ARJ / RMVSTRL.ASM < prev    next >
Assembly Source File  |  1991-10-12  |  1KB  |  66 lines

  1. StdGrp        group    stdlib,stddata
  2. stddata        segment    para public 'sldata'
  3. stddata        ends
  4. ;
  5. stdlib        segment    para public 'slcode'
  6.         assume    cs:stdgrp
  7. ;
  8. ;
  9. ; RmvStrl-    Removes a set of characters (given by the string following
  10. ;        the call) from a set.
  11. ;
  12. ; inputs:
  13. ;
  14. ;    ES:DI-  Points at the set (at its mask byte).
  15. ;    CS:RET- Points at the string.
  16. ;
  17. ;
  18.         public    sl_RmvStrl
  19. ;
  20. sl_RmvStrl    proc    far
  21.         push    bp
  22.         mov    bp, sp
  23.         push    ds
  24.         push    es
  25.         push    ax
  26.         push    bx
  27.         push    cx
  28.         push    si
  29.                 push    di
  30. ;
  31.         mov    si, di
  32.         mov    ax, es
  33.         mov    ds, ax
  34.         les    di, 2[bp]
  35.         mov    al, 0
  36.         mov    cx, 0ffffh
  37.     repne    scasb
  38.         xchg    2[bp], di
  39. ;
  40. ;
  41.         mov    al, [si]        ;Get mask byte
  42.                 not    al
  43.         add    si, 8            ;Skip to start of set
  44.         mov    bh, 0
  45.                 jmp    IntoLp
  46. RmvLp:        and    [si][bx], al        ;Add to set
  47.         inc    di            ;Move on to next char.
  48. IntoLp:        mov    bl, es:[di]
  49.         cmp    bl, 0
  50.         jnz    RmvLp
  51. ;
  52.         pop    di
  53.         pop    si
  54.         pop    cx
  55.         pop    bx
  56.         pop    ax
  57.         pop    es
  58.         pop    ds
  59.         pop    bp
  60.         ret
  61. sl_RmvStrl    endp
  62. ;
  63. ;
  64. stdlib        ends
  65.         end
  66.